import org.example.IdeaApplication;
import org.example.web.controller.UserController;
import org.example.web.entity.SysUser;
import org.example.web.service.IUserService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = {IdeaApplication.class})
public class testUserService {

    private static final Logger logger = LoggerFactory.getLogger(UserController.class);

    @Autowired
    private IUserService userService;

    @Before
    public void before() {
        logger.info("单元测试开始！");
    }

    @Test
    public void test01() {
        SysUser A = new SysUser();
        logger.info("用户记录：{}", userService.selectById(1L));
    }

    @After
    public void after() {
        logger.info("单元测试结束！");
    }

}
